package com.yangff.entity.product.entity.productentity;

//债券

import com.yangff.entity.product.entity.Financialproduct;
import com.yangff.utils.MathUtil;

public class BondEntity extends Financialproduct {
    public BondEntity() {
        super();
        setStockType(MathUtil.getRandomNumberInIntegerRange(1, 2));

    }

    private void setStockType(Integer type) {
        switch (type) {
            case 1:
                this.type = "政府债券型";
                this.mu = MathUtil.getRandomNumberInDoubleRange(0.01, 0.04);
                this.sigma = MathUtil.getRandomNumberInDoubleRange(0.01, 0.03);
                this.riskLevel = MathUtil.getRiskLevel(sigma , 0.01 , 0.04);
                break;
            case 2:
                this.type = "企业债券型";
                this.mu = MathUtil.getRandomNumberInDoubleRange(0.03, 0.06);
                this.sigma = MathUtil.getRandomNumberInDoubleRange(0.03, 0.08);
                this.riskLevel = MathUtil.getRiskLevel(sigma , 0.03 , 0.08);
                break;
        }
    }
}
